package com.wx.servlet;

import com.wx.domain.Doctor;
import com.wx.service.DoctorService;
import com.wx.service.PatientService;
import com.wx.service.impl.DoctorServiceImpl;
import com.wx.service.impl.PatientServiceImpl;
import org.w3c.dom.Document;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/modifyDoctor")
public class ModifyDoctor extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        resp.setContentType("text/html; charset=UTF-8");

        String username = req.getParameter("username");
        String password = req.getParameter("password");
        DoctorService doctorService=new DoctorServiceImpl();
        doctorService.modifyPassword(username,password);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req,resp);
    }
}
